package com.test.test.utils.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

//@Aspect
//@Component

public class Advice {

	@Pointcut("")
	public void log(){
		
	}
	@Around("log()")
	public Object aroundDemo( ProceedingJoinPoint joinPoint) throws Throwable{
		System.out.println("before  ");
		Object result = new Object();
		try {
			result =joinPoint.proceed(joinPoint.getArgs());
			System.out.println("AfterReturning  ");
		} catch (Throwable e) {
			// TODO Auto-generated catch block
			System.out.println("exception finally");
			throw e;
			//e.printStackTrace();
		}finally{
			System.out.println("After finally");
		}
		return result;
	}
}
